<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="model.User"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
 <a href="./user?opt=add">添加</a>
<table width="100%" border="1">
   <tr>
       <td>用户姓名</td>
       <td>性别</td>
       <td>联系电话</td>
       <td>联系QQ</td>
       <td>地址</td>
       <td>操作</td>
   </tr>
   <%
      Object obj = request.getAttribute("users");
      if(obj != null)
      {
    	  List<User> users = (List<User>)obj;
    	  Iterator it = users.iterator();
    	  while(it.hasNext())
    	  {
    		  User u = (User)it.next();
    		  %>
    		  <tr>
                   <td><%=u.getUserName() %></td>
                   <td><%=u.getSex() %></td>
                   <td><%=u.getPhone() %></td>
                   <td><%=u.getQq() %></td>
                   <td><%=u.getAddress() %></td>
                  
              </tr>
    		  <%
    	  }
      }
   
   %>
   
</table> 

</body>
</html>